﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_JH_YONGHUYSSJ实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_JH_YONGHUYSSJ
    {
        private double m_db_n_chaojihje;

        private double m_db_n_danhao;

        private double m_db_n_fuyonglv;

        private double m_db_n_jiajiaje;

        private double m_db_n_ysj;

        private decimal m_dec_i_chaojianl;

        private decimal m_dec_i_chaojihsl;

        private decimal m_dec_i_chutiaoz;

        private decimal m_dec_i_fenbiaol;

        private decimal m_dec_i_fuyongl;

        private decimal m_dec_i_gubiaos;

        private decimal m_dec_i_huiguanl;

        private decimal m_dec_i_jiajiacs;

        private decimal m_dec_i_jiajial;

        private decimal m_dec_i_jijianjh;

        private decimal m_dec_i_jlzt;

        private decimal m_dec_i_jutiaoz;

        private decimal m_dec_i_m;

        private decimal m_dec_i_shiyongjh;

        private decimal m_dec_i_shiyongsl;

        private decimal m_dec_i_waigongjh;

        private decimal m_dec_i_y;

        private decimal m_dec_i_yuanjihua;

        private decimal m_dec_id;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_beiyong3;

        private string m_str_s_beiyong4;

        private string m_str_s_yonghuh;

        private string m_str_s_zhandianbh;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     站点
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        ///     用户号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        ///     水量年
        /// </summary>
        public decimal I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     水量月
        /// </summary>
        public decimal I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     原计划
        /// </summary>
        public decimal I_YUANJIHUA
        {
            get { return m_dec_i_yuanjihua; }
            set { m_dec_i_yuanjihua = value; }
        }

        /// <summary>
        ///     局调整
        /// </summary>
        public decimal I_JUTIAOZ
        {
            get { return m_dec_i_jutiaoz; }
            set { m_dec_i_jutiaoz = value; }
        }

        /// <summary>
        ///     处调整
        /// </summary>
        public decimal I_CHUTIAOZ
        {
            get { return m_dec_i_chutiaoz; }
            set { m_dec_i_chutiaoz = value; }
        }

        /// <summary>
        ///     实用计划
        /// </summary>
        public decimal I_SHIYONGJH
        {
            get { return m_dec_i_shiyongjh; }
            set { m_dec_i_shiyongjh = value; }
        }

        /// <summary>
        ///     抄见量
        /// </summary>
        public decimal I_CHAOJIANL
        {
            get { return m_dec_i_chaojianl; }
            set { m_dec_i_chaojianl = value; }
        }

        /// <summary>
        ///     基建计划
        /// </summary>
        public decimal I_JIJIANJH
        {
            get { return m_dec_i_jijianjh; }
            set { m_dec_i_jijianjh = value; }
        }

        /// <summary>
        ///     外供计划
        /// </summary>
        public decimal I_WAIGONGJH
        {
            get { return m_dec_i_waigongjh; }
            set { m_dec_i_waigongjh = value; }
        }

        /// <summary>
        ///     回灌量
        /// </summary>
        public decimal I_HUIGUANL
        {
            get { return m_dec_i_huiguanl; }
            set { m_dec_i_huiguanl = value; }
        }

        /// <summary>
        ///     实用量
        /// </summary>
        public decimal I_SHIYONGSL
        {
            get { return m_dec_i_shiyongsl; }
            set { m_dec_i_shiyongsl = value; }
        }

        /// <summary>
        ///     用水价
        /// </summary>
        public double N_YSJ
        {
            get { return m_db_n_ysj; }
            set { m_db_n_ysj = value; }
        }

        /// <summary>
        ///     加价次数
        /// </summary>
        public decimal I_JIAJIACS
        {
            get { return m_dec_i_jiajiacs; }
            set { m_dec_i_jiajiacs = value; }
        }

        /// <summary>
        ///     超计划金额
        /// </summary>
        public double N_CHAOJIHJE
        {
            get { return m_db_n_chaojihje; }
            set { m_db_n_chaojihje = value; }
        }

        /// <summary>
        ///     加价量
        /// </summary>
        public decimal I_JIAJIAL
        {
            get { return m_dec_i_jiajial; }
            set { m_dec_i_jiajial = value; }
        }

        /// <summary>
        ///     加价金额
        /// </summary>
        public double N_JIAJIAJE
        {
            get { return m_db_n_jiajiaje; }
            set { m_db_n_jiajiaje = value; }
        }

        /// <summary>
        ///     估表数
        /// </summary>
        public decimal I_GUBIAOS
        {
            get { return m_dec_i_gubiaos; }
            set { m_dec_i_gubiaos = value; }
        }

        /// <summary>
        ///     复用量
        /// </summary>
        public decimal I_FUYONGL
        {
            get { return m_dec_i_fuyongl; }
            set { m_dec_i_fuyongl = value; }
        }

        /// <summary>
        ///     复用率
        /// </summary>
        public double N_FUYONGLV
        {
            get { return m_db_n_fuyonglv; }
            set { m_db_n_fuyonglv = value; }
        }

        /// <summary>
        ///     单耗
        /// </summary>
        public double N_DANHAO
        {
            get { return m_db_n_danhao; }
            set { m_db_n_danhao = value; }
        }

        /// <summary>
        ///     分表量
        /// </summary>
        public decimal I_FENBIAOL
        {
            get { return m_dec_i_fenbiaol; }
            set { m_dec_i_fenbiaol = value; }
        }

        /// <summary>
        ///     删除状态(0:正常 -1:删除)
        /// </summary>
        public decimal I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     备用1
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        ///     备用2
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        ///     备用3
        /// </summary>
        public string S_BEIYONG3
        {
            get { return m_str_s_beiyong3; }
            set { m_str_s_beiyong3 = value; }
        }

        /// <summary>
        ///     备用4
        /// </summary>
        public string S_BEIYONG4
        {
            get { return m_str_s_beiyong4; }
            set { m_str_s_beiyong4 = value; }
        }

        /// <summary>
        ///     超计划水量
        /// </summary>
        public decimal I_CHAOJIHSL
        {
            get { return m_dec_i_chaojihsl; }
            set { m_dec_i_chaojihsl = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_JH_YONGHUYSSJProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_JH_YONGHUYSSJProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_JH_YONGHUYSSJ实体添加或者修改YS_JH_YONGHUYSSJ信息
        /// </summary>
        public bool InsertOrUpdate(YS_JH_YONGHUYSSJ YS_JH_YONGHUYSSJ, OracleTransaction Transaction)
        {
            if (YS_JH_YONGHUYSSJ.ID == 0)
                InsertYS_JH_YONGHUYSSJ(YS_JH_YONGHUYSSJ, Transaction);
            else
                UpdateYS_JH_YONGHUYSSJ(YS_JH_YONGHUYSSJ, Transaction);
            return YS_JH_YONGHUYSSJ.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_JH_YONGHUYSSJ实体添加或修改YS_JH_YONGHUYSSJ信息
        /// </summary>
        public bool InsertOrUpdate(YS_JH_YONGHUYSSJ YS_JH_YONGHUYSSJ)
        {
            return InsertOrUpdate(YS_JH_YONGHUYSSJ, null);
        }


        /// <summary>
        ///     根据YS_JH_YONGHUYSSJ主键删除YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_JH_YONGHUYSSJ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_JH_YONGHUYSSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_JH_YONGHUYSSJ主键删除YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_JH_YONGHUYSSJ(decimal ID)
        {
            return DeleteYS_JH_YONGHUYSSJ(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_JH_YONGHUYSSJsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_JH_YONGHUYSSJsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_JH_YONGHUYSSJsDynamic(string WhereClause)
        {
            return DeleteYS_JH_YONGHUYSSJsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_JH_YONGHUYSSJ主键选择YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_YONGHUYSSJ信息</returns>
        public YS_JH_YONGHUYSSJ SelectYS_JH_YONGHUYSSJ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YONGHUYSSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_JH_YONGHUYSSJ = PopulateYS_JH_YONGHUYSSJ(rd);
                rd.Close();
                return YS_JH_YONGHUYSSJ;
            }

            return null;
        }

        /// <summary>
        ///     根据YS_JH_YONGHUYSSJ主键选择YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <returns>YS_JH_YONGHUYSSJ信息</returns>
        public YS_JH_YONGHUYSSJ SelectYS_JH_YONGHUYSSJ(decimal ID)
        {
            return SelectYS_JH_YONGHUYSSJ(ID, null);
        }

        /// <summary>
        ///     选择所有YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_JH_YONGHUYSSJ信息</returns>
        public DataTable SelectYS_JH_YONGHUYSSJsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YONGHUYSSJsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }

            return null;
        }

        /// <summary>
        ///     选择所有YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <returns>所有YS_JH_YONGHUYSSJ信息</returns>
        public DataTable SelectYS_JH_YONGHUYSSJsAll()
        {
            return SelectYS_JH_YONGHUYSSJsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_YONGHUYSSJ信息</returns>
        public DataTable SelectYS_JH_YONGHUYSSJsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YONGHUYSSJsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }

            return null;
        }


        /// <summary>
        ///     根据条件选择YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_JH_YONGHUYSSJ信息</returns>
        public DataTable SelectYS_JH_YONGHUYSSJsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_JH_YONGHUYSSJsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_YONGHUYSSJ信息</returns>
        public DataTable SelectYS_JH_YONGHUYSSJsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_YONGHUYSSJsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }

            return null;
        }


        /// <summary>
        ///     根据条件选择YS_JH_YONGHUYSSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_JH_YONGHUYSSJ信息</returns>
        public DataTable SelectYS_JH_YONGHUYSSJsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_JH_YONGHUYSSJsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_JH_YONGHUYSSJ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_JH_YONGHUYSSJsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "") return 0;
            var spName = "CS_UpdYS_JH_YONGHUYSSJDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_JH_YONGHUYSSJ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_JH_YONGHUYSSJsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_JH_YONGHUYSSJsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_JH_YONGHUYSSJ(YS_JH_YONGHUYSSJ YS_JH_YONGHUYSSJ, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_JH_YONGHUYSSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_JH_YONGHUYSSJ.S_ZHANDIANBH;
            storedParams[1].Value = YS_JH_YONGHUYSSJ.S_YONGHUH;
            storedParams[2].Value = YS_JH_YONGHUYSSJ.I_Y;
            storedParams[3].Value = YS_JH_YONGHUYSSJ.I_M;
            storedParams[4].Value = YS_JH_YONGHUYSSJ.I_YUANJIHUA;
            storedParams[5].Value = YS_JH_YONGHUYSSJ.I_JUTIAOZ;
            storedParams[6].Value = YS_JH_YONGHUYSSJ.I_CHUTIAOZ;
            storedParams[7].Value = YS_JH_YONGHUYSSJ.I_SHIYONGJH;
            storedParams[8].Value = YS_JH_YONGHUYSSJ.I_CHAOJIANL;
            storedParams[9].Value = YS_JH_YONGHUYSSJ.I_JIJIANJH;
            storedParams[10].Value = YS_JH_YONGHUYSSJ.I_WAIGONGJH;
            storedParams[11].Value = YS_JH_YONGHUYSSJ.I_HUIGUANL;
            storedParams[12].Value = YS_JH_YONGHUYSSJ.I_SHIYONGSL;
            storedParams[13].Value = YS_JH_YONGHUYSSJ.N_YSJ;
            storedParams[14].Value = YS_JH_YONGHUYSSJ.I_JIAJIACS;
            storedParams[15].Value = YS_JH_YONGHUYSSJ.N_CHAOJIHJE;
            storedParams[16].Value = YS_JH_YONGHUYSSJ.I_JIAJIAL;
            storedParams[17].Value = YS_JH_YONGHUYSSJ.N_JIAJIAJE;
            storedParams[18].Value = YS_JH_YONGHUYSSJ.I_GUBIAOS;
            storedParams[19].Value = YS_JH_YONGHUYSSJ.I_FUYONGL;
            storedParams[20].Value = YS_JH_YONGHUYSSJ.N_FUYONGLV;
            storedParams[21].Value = YS_JH_YONGHUYSSJ.N_DANHAO;
            storedParams[22].Value = YS_JH_YONGHUYSSJ.I_FENBIAOL;
            storedParams[23].Value = YS_JH_YONGHUYSSJ.I_JLZT;
            storedParams[24].Value = YS_JH_YONGHUYSSJ.S_BEIYONG1;
            storedParams[25].Value = YS_JH_YONGHUYSSJ.S_BEIYONG2;
            storedParams[26].Value = YS_JH_YONGHUYSSJ.S_BEIYONG3;
            storedParams[27].Value = YS_JH_YONGHUYSSJ.S_BEIYONG4;
            storedParams[28].Value = YS_JH_YONGHUYSSJ.I_CHAOJIHSL;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_JH_YONGHUYSSJ.ID = Convert.ToInt32(storedParams[29].Value);
            return result;
        }

        private bool UpdateYS_JH_YONGHUYSSJ(YS_JH_YONGHUYSSJ YS_JH_YONGHUYSSJ, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_JH_YONGHUYSSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_JH_YONGHUYSSJ.S_ZHANDIANBH;
            storedParams[1].Value = YS_JH_YONGHUYSSJ.S_YONGHUH;
            storedParams[2].Value = YS_JH_YONGHUYSSJ.I_Y;
            storedParams[3].Value = YS_JH_YONGHUYSSJ.I_M;
            storedParams[4].Value = YS_JH_YONGHUYSSJ.I_YUANJIHUA;
            storedParams[5].Value = YS_JH_YONGHUYSSJ.I_JUTIAOZ;
            storedParams[6].Value = YS_JH_YONGHUYSSJ.I_CHUTIAOZ;
            storedParams[7].Value = YS_JH_YONGHUYSSJ.I_SHIYONGJH;
            storedParams[8].Value = YS_JH_YONGHUYSSJ.I_CHAOJIANL;
            storedParams[9].Value = YS_JH_YONGHUYSSJ.I_JIJIANJH;
            storedParams[10].Value = YS_JH_YONGHUYSSJ.I_WAIGONGJH;
            storedParams[11].Value = YS_JH_YONGHUYSSJ.I_HUIGUANL;
            storedParams[12].Value = YS_JH_YONGHUYSSJ.I_SHIYONGSL;
            storedParams[13].Value = YS_JH_YONGHUYSSJ.N_YSJ;
            storedParams[14].Value = YS_JH_YONGHUYSSJ.I_JIAJIACS;
            storedParams[15].Value = YS_JH_YONGHUYSSJ.N_CHAOJIHJE;
            storedParams[16].Value = YS_JH_YONGHUYSSJ.I_JIAJIAL;
            storedParams[17].Value = YS_JH_YONGHUYSSJ.N_JIAJIAJE;
            storedParams[18].Value = YS_JH_YONGHUYSSJ.I_GUBIAOS;
            storedParams[19].Value = YS_JH_YONGHUYSSJ.I_FUYONGL;
            storedParams[20].Value = YS_JH_YONGHUYSSJ.N_FUYONGLV;
            storedParams[21].Value = YS_JH_YONGHUYSSJ.N_DANHAO;
            storedParams[22].Value = YS_JH_YONGHUYSSJ.I_FENBIAOL;
            storedParams[23].Value = YS_JH_YONGHUYSSJ.I_JLZT;
            storedParams[24].Value = YS_JH_YONGHUYSSJ.S_BEIYONG1;
            storedParams[25].Value = YS_JH_YONGHUYSSJ.S_BEIYONG2;
            storedParams[26].Value = YS_JH_YONGHUYSSJ.S_BEIYONG3;
            storedParams[27].Value = YS_JH_YONGHUYSSJ.S_BEIYONG4;
            storedParams[28].Value = YS_JH_YONGHUYSSJ.I_CHAOJIHSL;
            storedParams[29].Value = YS_JH_YONGHUYSSJ.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_JH_YONGHUYSSJ PopulateYS_JH_YONGHUYSSJ(IDataReader dr)
        {
            var YS_JH_YONGHUYSSJ = new YS_JH_YONGHUYSSJ();
            YS_JH_YONGHUYSSJ.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_JH_YONGHUYSSJ.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? "" : (string) dr["S_ZHANDIANBH"];
            YS_JH_YONGHUYSSJ.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? "" : (string) dr["S_YONGHUH"];
            YS_JH_YONGHUYSSJ.I_Y = dr["I_Y"] == DBNull.Value ? 0 : (decimal) dr["I_Y"];
            YS_JH_YONGHUYSSJ.I_M = dr["I_M"] == DBNull.Value ? 0 : (decimal) dr["I_M"];
            YS_JH_YONGHUYSSJ.I_YUANJIHUA = dr["I_YUANJIHUA"] == DBNull.Value ? 0 : (decimal) dr["I_YUANJIHUA"];
            YS_JH_YONGHUYSSJ.I_JUTIAOZ = dr["I_JUTIAOZ"] == DBNull.Value ? 0 : (decimal) dr["I_JUTIAOZ"];
            YS_JH_YONGHUYSSJ.I_CHUTIAOZ = dr["I_CHUTIAOZ"] == DBNull.Value ? 0 : (decimal) dr["I_CHUTIAOZ"];
            YS_JH_YONGHUYSSJ.I_SHIYONGJH = dr["I_SHIYONGJH"] == DBNull.Value ? 0 : (decimal) dr["I_SHIYONGJH"];
            YS_JH_YONGHUYSSJ.I_CHAOJIANL = dr["I_CHAOJIANL"] == DBNull.Value ? 0 : (decimal) dr["I_CHAOJIANL"];
            YS_JH_YONGHUYSSJ.I_JIJIANJH = dr["I_JIJIANJH"] == DBNull.Value ? 0 : (decimal) dr["I_JIJIANJH"];
            YS_JH_YONGHUYSSJ.I_WAIGONGJH = dr["I_WAIGONGJH"] == DBNull.Value ? 0 : (decimal) dr["I_WAIGONGJH"];
            YS_JH_YONGHUYSSJ.I_HUIGUANL = dr["I_HUIGUANL"] == DBNull.Value ? 0 : (decimal) dr["I_HUIGUANL"];
            YS_JH_YONGHUYSSJ.I_SHIYONGSL = dr["I_SHIYONGSL"] == DBNull.Value ? 0 : (decimal) dr["I_SHIYONGSL"];
            YS_JH_YONGHUYSSJ.N_YSJ = dr["N_YSJ"] == DBNull.Value ? 0 : (double) dr["N_YSJ"];
            YS_JH_YONGHUYSSJ.I_JIAJIACS = dr["I_JIAJIACS"] == DBNull.Value ? 0 : (decimal) dr["I_JIAJIACS"];
            YS_JH_YONGHUYSSJ.N_CHAOJIHJE = dr["N_CHAOJIHJE"] == DBNull.Value ? 0 : (double) dr["N_CHAOJIHJE"];
            YS_JH_YONGHUYSSJ.I_JIAJIAL = dr["I_JIAJIAL"] == DBNull.Value ? 0 : (decimal) dr["I_JIAJIAL"];
            YS_JH_YONGHUYSSJ.N_JIAJIAJE = dr["N_JIAJIAJE"] == DBNull.Value ? 0 : (double) dr["N_JIAJIAJE"];
            YS_JH_YONGHUYSSJ.I_GUBIAOS = dr["I_GUBIAOS"] == DBNull.Value ? 0 : (decimal) dr["I_GUBIAOS"];
            YS_JH_YONGHUYSSJ.I_FUYONGL = dr["I_FUYONGL"] == DBNull.Value ? 0 : (decimal) dr["I_FUYONGL"];
            YS_JH_YONGHUYSSJ.N_FUYONGLV = dr["N_FUYONGLV"] == DBNull.Value ? 0 : (double) dr["N_FUYONGLV"];
            YS_JH_YONGHUYSSJ.N_DANHAO = dr["N_DANHAO"] == DBNull.Value ? 0 : (double) dr["N_DANHAO"];
            YS_JH_YONGHUYSSJ.I_FENBIAOL = dr["I_FENBIAOL"] == DBNull.Value ? 0 : (decimal) dr["I_FENBIAOL"];
            YS_JH_YONGHUYSSJ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? 0 : (decimal) dr["I_JLZT"];
            YS_JH_YONGHUYSSJ.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_JH_YONGHUYSSJ.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_JH_YONGHUYSSJ.S_BEIYONG3 = dr["S_BEIYONG3"] == DBNull.Value ? null : (string) dr["S_BEIYONG3"];
            YS_JH_YONGHUYSSJ.S_BEIYONG4 = dr["S_BEIYONG4"] == DBNull.Value ? null : (string) dr["S_BEIYONG4"];
            YS_JH_YONGHUYSSJ.I_CHAOJIHSL = dr["I_CHAOJIHSL"] == DBNull.Value ? 0 : (decimal) dr["I_CHAOJIHSL"];
            return YS_JH_YONGHUYSSJ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++) dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion